package de.mhus.lib.mandala.functions;

import java.io.PrintWriter;
import java.util.LinkedList;
import java.util.List;

import de.mhus.lib.mandala.Function;
import de.mhus.lib.mandala.Response;

public class SequenceAction extends Function {
	
	private LinkedList<Function> actions = new LinkedList<Function>();

	public SequenceAction() {
	}
	
	public SequenceAction(Function...actions) {
		for (Function a : actions)
			this.actions.add(a);
	}
	
	@Override
	public void doRender(Response out) {
		out.println("function() {");
		for (Function a : actions) {
			// a.doRender(getParent(),out);
			a.renderElementCall(out);
			out.println(";");
		}
		out.println("}");
	}
	
	public List<Function> getActions() {
		return actions;
	}
	

}
